| Conditions | 2 |
| Total Lines | 21 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { Injectable } from '@nestjs/common'; |
||
| 12 | |||
| 13 | public async send(mail: IMail): Promise<void> { |
||
| 14 | const baseUrl = this.configService.get<string>('BASE_URL'); |
||
| 15 | |||
| 16 | try { |
||
| 17 | setApiKey(this.configService.get<string>('SENDGRID_API_KEY')); |
||
| 18 | await send({ |
||
| 19 | from: this.configService.get<string>('MAIL_SENDER'), |
||
| 20 | templateId: mail.templateId, |
||
| 21 | personalizations: [ |
||
| 22 | { |
||
| 23 | to: mail.to, |
||
| 24 | dynamicTemplateData: { |
||
| 25 | ...mail.payload, |
||
| 26 | baseUrl |
||
| 27 | } |
||
| 28 | } |
||
| 29 | ], |
||
| 30 | }); |
||
| 31 | } catch (error) { |
||
| 32 | console.warn(error); |
||
| 33 | } |
||
| 36 |